//
// Description: 5814. 新增的最少台阶数
// Created by Loading on 2021/7/18.
//

#include <bits/stdc++.h>

using namespace std;

int addRungs(vector<int> &rungs, int dist) {
    int cnt = 0;
    // 上一个台阶的位置
    int last_rung = 0;
    for (int rung : rungs) {
        int diff = rung - last_rung;
        if (diff > dist) {
            // 需要填充台阶的个数
            cnt += (diff - 1) / dist;
        }
        last_rung = rung;
    }

    return cnt;
}

int main() {
    vector<int> rungs = {10};
    int dist = 3;
    cout << addRungs(rungs, dist) << endl;
}
